#include "yasaisqltablemodel.h"

YasaiSqlTableModel::YasaiSqlTableModel(QObject *parent, QSqlDatabase db) :
    QSqlTableModel(parent, db)
{
}

YasaiSqlTableModel::~YasaiSqlTableModel()
{
}

QVariant YasaiSqlTableModel::data(const QModelIndex &index, int role) const
{
    QVariant value = QSqlTableModel::data(index, role);
    if (role != Qt::DisplayRole) return value;
    // column 3 - timestamp
    if (index.column() == 3) return QDateTime::fromTime_t(value.toInt());
    return value;
}
